/*
 * @Description:
 * @Version: 2.0
 * @Autor: Seven
 * @Date: 2025-04-25 14:35:25
 * @LastEditors: Seven
 * @LastEditTime: 2025-04-27 14:14:13
 */
// 实体管理器对象（存储所有高亮区域实体）
export const highlightEntityManager = {
  entities: new Map(), // 存储格式: { [id]: Cesium.Entity[] }
  // 清除所有实体
  clearById: function (viewer) {
    if (this.entities.size === 0) {
      console.log("Map 为空，无需操作");
      return;
    }
    // 清空 Map 并移除 Cesium 实体
    for (const [key, entity] of this.entities) {
      viewer.entities.remove(entity[0]); // 从 Cesium 场景中移除实体
    }
  },

  // 添加新实体组
  addEntities: function (id, entities) {
    this.entities.set(id, entities);
  }
};
